package novel.common.cglib;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
import org.springframework.cglib.proxy.Enhancer;

/**
 * Created by sutong on 2017/5/19.
 */
public class CglibProxyFactory implements MethodInterceptor{
    private Object tagetObject;

    public Object createProxyIntance(Object targetObject){
        this.tagetObject=targetObject;
        Enhancer enhancer=new Enhancer();
        enhancer.setSuperclass(this.tagetObject.getClass());
//        enhancer.setCallback(this);
        return enhancer;
    }

    @Override
    public Object invoke(MethodInvocation methodInvocation) throws Throwable {
        return null;
    }
}
